package top.wyloop.intoeins.module.ledger.model.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import top.wyloop.intoeins.util.PrimaryKeyGenerator;

/**
 * 记账账户
 *
 * @author Wyatt6
 * @date 2025/3/28
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "tb_ledger_account", indexes = {
        @Index(columnList = "userId")
})
public class Account {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "PK_generator")
    @GenericGenerator(name = "PK_generator", type = PrimaryKeyGenerator.class)
    private Long id;            // 主键
    @Column(nullable = false)
    private Long userId;        // 用户ID
    @Column(nullable = false)
    private String name;        // 记账账户名称
    @Column(nullable = false)
    private Boolean activated;  // 激活标志
    @Column
    private Long sortId;        // 排序ID
}
